Private Sub ITheme_MouseDownHanlder(iButton As Integer, iShift As Integer, sngX As Single, sngY As Single)
Dim iCnt As Integer
Dim iX As Integer
Dim iY As Integer
Dim utTabInfo As TabInfo
iX = CInt(sngX)
iY = CInt(sngY)
If iY > IIf(m_iActiveTabHeight > m_iInActiveTabHeight, m_iActiveTabHeight, m_iInActiveTabHeight) Then
'if lower than the larger tab height then exit sub since anything lower than
'active tab's height will not result in a tab switch
Exit Sub
End If
'now go through each tab's rect to determine if the mouse was clicked within its boundaries
For iCnt = 0 To m_iTabCount - 1
utTabInfo = m_oXTab.aryTabs(iCnt)
If iX >= utTabInfo.ClickableRect.Left And iX <= utTabInfo.ClickableRect.Right And iY >= utTabInfo.ClickableRect.Top And iY <= utTabInfo.ClickableRect.Bottom And utTabInfo.Enabled Then
'if its the active tab then no need to switch
If m_iActiveTab <> iCnt Then
m_oXTab.ActiveTab = iCnt
End If
Exit Sub 'our work is finished .... no need to itirate further
End If
Next
End Sub
Private Sub ITheme_MouseMoveHanlder(iButton As Integer, iShift As Integer, sngX As Single, sngY As Single)
'not used
End Sub
Private Sub ITheme_MouseUpHanlder(iButton As Integer, iShift As Integer, sngX As Single, sngY As Single)
'Do Nothing
End Sub
'IMPORTANT: must be called before anything else is called... this function is called in the usercontrol
'the time the object is instantiated
Private Sub ITheme_SetControl(oXTab As XTab)
Set m_oXTab = oXTab
m_oXTab.bAutoRedraw = False
End Sub
Private Sub ITheme_ShowHideFocus()
Call pCacheControlProperties
Select Case m_oXTab.TabStyle
Case xStylePropertyPages
ITheme_ShowHideFocusPropertyPages
Case xStyleTabbedDialog
ITheme_ShowHideFocusTabbedDialog
End Select
End Sub
Private Sub ITheme_ShowHideFocusPropertyPages()
Dim utFontRect As RECT
Dim utTabInfo As TabInfo
Dim iTmpW As Integer
Dim iTmpH As Integer
Dim sTmp As String
Dim iAdjustedIconSize As Integer
Dim iOrigLeft As Integer
If Not m_oXTab.bUserMode Then 'only if in the run mode
Exit Sub
End If
If Not m_oXTab.ShowFocusRect Then 'only if Show Focus Rect is true for the control
Exit Sub
End If
utTabInfo = m_oXTab.aryTabs(m_iActiveTab)
With utTabInfo.ClickableRect
'do the adjustments for the border
utFontRect.Left = .Left
utFontRect.Top = .Top
utFontRect.Bottom = .Bottom
utFontRect.Right = .Right - 1
sTmp = utTabInfo.Caption
If Not utTabInfo.TabPicture Is Nothing Then
If utFontRect.Top + m_iIconSize > utFontRect.Bottom + 1 Then '+1 for minor adjustments